package array.copy;

public class ArrayCopyMain {
	
	public static void main(String[] args) {
		
		int[] source = new int[]{1,2,3,4,5};
		
		ArrayCopy c = new ArrayCopy();
		
		int[] result = c.copyArray(source);
		
		for (int i = 0; i < result.length; i++) {
			System.out.println("result[" + i + "]: " +
					result[i]);
		}
		
		// 참조값 비교
		System.out.println("source: " + source);
		System.out.println("result: " + result);
		
		int[] target = new int[source.length];
		
		c.copyArray(source, target);
		
		for (int i = 0; i < target.length; i++) {
			System.out.println("target[" + i + "]: " +
					target[i]);
		}
		
		// 참조값 비교
		System.out.println("source: " + source);
		System.out.println("target: " + target);
		
	}
	
}
